﻿//-----------------------------------------------------------------------
//  This file is part of the Microsoft Code Samples.
// 
//  Copyright (C) Microsoft Corporation.  All rights reserved.
// 
//  This source code is intended only as a supplement to Microsoft
//  Development Tools and/or on-line documentation.  See these other
//  materials for detailed information regarding Microsoft code samples.
// 
//  THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//-----------------------------------------------------------------------

namespace Microsoft.Samples.SqlServer
{
    #region Using directives

    using System;
    using System.Collections.Generic;
    using System.Text;

    #endregion

    public class LogItem
    {
        public enum LogType {
            Connection = 0,
            Session
        };

        public enum LogAction {
            Cancel = 0
        };

        private object itemValue = string.Empty;
        private LogItem.LogAction itemAction;
        private LogItem.LogType itemType;
        private string serverName = string.Empty;
        private List<string> additionalData;

        public LogItem(LogItem.LogType type, LogItem.LogAction action, object value, string server)
        {
            this.itemAction = action;
            this.itemType = type;
            this.itemValue = value;
            this.serverName = server;
            this.additionalData = new List<string>();
        }

        public LogItem()
        {
            this.additionalData = new List<string>();
        }

        #region Public Properties
        public string ServerName
        {
            get
            {
                return this.serverName;
            }

            set
            {
                this.serverName = value;
            }
        }

        public LogItem.LogType ItemType
        {
            get
            {
                return this.itemType;
            }

            set
            {
                this.itemType = value;
            }
        }

        public LogItem.LogAction ItemAction
        {
            get
            {
                return this.itemAction;
            }

            set
            {
                this.itemAction = value;
            }
        }

        public object ItemValue
        {
            get
            {
                return this.itemValue;
            }

            set
            {
                this.itemValue = value;
            }
        }

        internal List<string> AdditionalData
        {
            get
            {
                return this.additionalData;
            }

            ////set
            ////{
            ////    this.additionalData = value;
            ////}
        }
        #endregion
    }
}
